﻿@using Library
@model Ecommerce.Models.EditRoleViewModel

@using (Ajax.BeginForm("EditRole", "Admin",
    new AjaxOptions
    {
        HttpMethod = "POST",
        AllowCache = false,
        UpdateTargetId = "formctnr",
        InsertionMode = InsertionMode.Replace,
        OnSuccess = "onSuccess",
        OnFailure = "onFailure"
    }, new { @id = "roleForm", @class = "form-horizontal" }))
{
    <div class="modal-body">
        @Html.AntiForgeryToken()
        @Html.HiddenFor(m => m.Id)
        <div class="form-group">
            <label class="col-sm-2 control-label">@NOWCulture.GetString("Role name")</label>
            <div class="col-md-10">
                <div class="col-sm-10">
                    @Html.TextBoxFor(m => m.Name, new { @class = "form-control", @readonly = "true" })
                    @Html.ValidationMessageFor(m => m.Name, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">@NOWCulture.GetString("Description")</label>
            <div class="col-md-10">
                <div class="col-sm-10">
                    @Html.TextBoxFor(m => m.Description, new { @class = "form-control" })
                    @Html.ValidationMessageFor(m => m.Description, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>
        @Html.ValidationSummary(true, "", new { @class = "bg-danger" })
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">@NOWCulture.GetString("Close")</button>
        <input type="submit" class="btn btn-primary" value="@NOWCulture.GetString("Save")">
    </div>
    @Scripts.Render("~/Scripts/admin.edit.role.js");
}

